﻿using System;
using System.Runtime.InteropServices;

namespace boda.net.wpf.core.Models;
/// <summary>
/// 表示一张图像
/// </summary>
public class Img
{
    /// <summary>
    /// 图像数据指针
    /// </summary>
    public IntPtr Header { get; set; }

    public long Width { get; set; }
    public long Height { get; set; }

    public long Length => Width * Height * Marshal.SizeOf(typeof(ColorBGR));

    public Img(UnmanagedArray2D<ColorBGR> data)
    {
        Header = data.Header;
        Width = data.Width;
        Height = data.Height;
    }
}
